package org.dingyom.gift.controller;

import org.dingyom.gift.util.AjaxResult;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/oauth")
public class OauthTestController {

    @GetMapping("/test/{id}")
    @PreAuthorize("hasAuthority('oauth:test')")
    public AjaxResult test(@PathVariable("id") Long id){
        return AjaxResult.me().setResultObj(id);
    }
}
